/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f0f8ff;
  color: #333;
}

/* 游戏容器 */
.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
  background-color: #fff;
  min-height: 100vh;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

/* 资源显示 */
.resources {
  display: flex;
  gap: 15px;
}

.resource {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  padding: 5px 10px;
  background-color: #f5f5f5;
  border-radius: 20px;
}

/* 菜单按钮 */
.menu-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

/* 天气横幅 */
.weather-banner {
  text-align: center;
  padding: 10px;
  background-color: #e3f2fd;
  margin-bottom: 15px;
  border-radius: 5px;
  font-weight: bold;
}

/* 游戏主区域 */
.game-main {
  min-height: 400px;
  margin-bottom: 20px;
}

/* 农场区域 */
.farm-area {
  padding: 10px;
}

.farm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.farm-cell {
  aspect-ratio: 1;
  background-color: #8D6E63;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.farm-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 10 L10 0 L20 10 L10 20 Z" fill="rgba(121, 85, 72, 0.3)"/></svg>');
  background-size: 20px 20px;
  opacity: 0.3;
}

.farm-cell:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.farm-cell.has-plant {
  background-color: #66BB6A;
}

.farm-cell.watered {
  background-color: #42A5F5;
}

.farm-cell.dead {
  background-color: #EF5350;
}

.plant {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.plant i {
  font-size: 30px;
  color: #558B2F;
}

.plant-stage {
  font-size: 12px;
  margin-top: 5px;
  background-color: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 商店区域 */
.shop-area {
  padding: 10px;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.shop-item {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.shop-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.shop-item i {
  font-size: 24px;
  color: #4CAF50;
}

.item-name {
  font-weight: bold;
}

.item-price {
  color: #FF9800;
  font-weight: bold;
}

/* 背包区域 */
.backpack-area {
  padding: 10px;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.filter-buttons button {
  flex: 1;
  padding: 8px;
  background-color: #f5f5f5;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-buttons button.active {
  background-color: #4CAF50;
  color: white;
}

.backpack-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.backpack-item {
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.backpack-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.backpack-item i {
  font-size: 20px;
  color: #2196F3;
}

.item-count {
  background-color: #FF9800;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* 底部导航 */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  background-color: #f5f5f5;
  border-radius: 10px;
  margin-top: 20px;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  transition: all 0.3s ease;
}

.bottom-nav button.active {
  color: #4CAF50;
}

.bottom-nav button i {
  font-size: 24px;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.modal-content button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background-color: #f5f5f5;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-content button:hover {
  background-color: #e0e0e0;
}

.modal-content button i {
  width: 20px;
  text-align: center;
}

/* 设置项 */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
}

.setting-item label {
  font-weight: 500;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* 通知系统 */
.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 1001;
  animation: fadeInOut 3s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  90% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* 响应式调整 */
@media (max-width: 600px) {
  .farm-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .shop-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .backpack-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 400px) {
  .resources {
    gap: 8px;
  }

  .resource {
    padding: 3px 8px;
    font-size: 12px;
  }

  .shop-items {
    grid-template-columns: 1fr;
  }

  .backpack-items {
    grid-template-columns: repeat(2, 1fr);
  }
}